﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.WmsManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.WmsManagement.StoretakeVMs
{
    public partial class StoretakeTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._Storetake._Material")]
        public ExcelPropety Material_Excel = ExcelPropety.CreateProperty<Storetake>(x => x.MaterialId);
        [Display(Name = "_Model._Storetake._MaterialName")]
        public ExcelPropety MaterialName_Excel = ExcelPropety.CreateProperty<Storetake>(x => x.MaterialName);
        [Display(Name = "_Model._Storetake._Sheet")]
        public ExcelPropety Sheet_Excel = ExcelPropety.CreateProperty<Storetake>(x => x.SheetId);
        [Display(Name = "_Model._Storetake._SheetCode")]
        public ExcelPropety SheetCode_Excel = ExcelPropety.CreateProperty<Storetake>(x => x.SheetCode);
        [Display(Name = "_Model._Storetake._ExpectedQty")]
        public ExcelPropety ExpectedQty_Excel = ExcelPropety.CreateProperty<Storetake>(x => x.ExpectedQty);
        [Display(Name = "_Model._Storetake._CountedQty")]
        public ExcelPropety CountedQty_Excel = ExcelPropety.CreateProperty<Storetake>(x => x.CountedQty);
        [Display(Name = "_Model._Storetake._VarianceQty")]
        public ExcelPropety VarianceQty_Excel = ExcelPropety.CreateProperty<Storetake>(x => x.VarianceQty);
        [Display(Name = "_Model._Storetake._StocktakeDate")]
        public ExcelPropety StocktakeDate_Excel = ExcelPropety.CreateProperty<Storetake>(x => x.StocktakeDate, true);
        [Display(Name = "_Model._Storetake._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<Storetake>(x => x.CreateTime, true);
        [Display(Name = "_Model._Storetake._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<Storetake>(x => x.UpdateTime, true);
        [Display(Name = "_Model._Storetake._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<Storetake>(x => x.CreateBy);
        [Display(Name = "_Model._Storetake._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<Storetake>(x => x.UpdateBy);
        [Display(Name = "_Model._Storetake._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<Storetake>(x => x.IsValid);
        [Display(Name = "_Model._Storetake._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<Storetake>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Material_Excel.DataType = ColumnDataType.ComboBox;
            Material_Excel.ListItems = DC.Set<MaterialDoc>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());
            Sheet_Excel.DataType = ColumnDataType.ComboBox;
            Sheet_Excel.ListItems = DC.Set<StoretakeSheet>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class StoretakeImportVM : BaseImportVM<StoretakeTemplateVM, Storetake>
    {
            //import

    }

}